import request from '../utils/request';

import {
  dictTestType,
  dictTestPosition,
  standardOperator
} from './constant';
import { debug } from 'util';

export function getAllDevice() {
  return request({
    url: 'device/getAll',
    method: 'get'
  });
}

// 零件类别列表
export function getPartTypeListByCondition(data) {
  return request({
    url: 'partType/partTypeList',
    method: 'get',
    data: data
  });
}



// 零件类别列表
export function getPartNumberList() {
  return request({
    url: 'part/getAllPart',
    method: 'get'
  });
}


// 零件类别保存
export function savePartType(data) {
  return request({
    url: 'partType/savePartType',
    method: 'post',
    data: data
  });
}

// 零件类别详细
export function partTypeInfo(id) {
  const data = {};
  return request({
    url: 'partType/partTypeInfo/' + id,
    method: 'get',
    data: data
  });
}

// 零件类别删除
export function deletePartType(id) {
  return request({
    url: 'partType/deletePartType/' + id,
    method: 'delete'
  });
}

//检测标准
export function getStandardList() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: 'DETECTION_STANDARD'
    }
  });
}
//检测类型分页
export function getTypeListByCondition(data) {
  return request({
    url: 'dict/dictListFromCondition',
    method: 'get',
    data: data
  });
}

//检测类型删除
export function deleteDict(id) {
  return request({
    url: 'dict/deleteDict/' + id,
    method: 'delete'
  });
}

//检测类型详细
export function getDictByCode(id) {
  return request({
    url: 'dict/getDictByCode/' + id,
    method: 'get'
  });
}

//检测类型详细
export function postsaveDict(data) {
  return request({
    url: 'dict/saveDict',
    method: 'post',
    data: data
  });
}

// 任务申请列表
export function getApplyListService(data) {
  return request({
    url: 'task/applyList',
    method: 'get',
    data: data,
  });
}

// 保存任务申请
export function postSaveApplyService(data) {
  return request({
    url: 'task/saveApply',
    method: 'post',
    data: data,
  });
}

// 任务申请详情
export function getApplyInfoByIdService(id) {
  const data = {
    'taskId': id,
  };
  return request({
    url: 'task/applyInfoById',
    method: 'get',
    data: data,
  });
}

export function getApplyInfoByTaskNoService(id) {
  const data = {
    'taskNo': id,
  };
  return request({
    url: 'task/applyInfoByTaskNo',
    method: 'get',
    data: data,
  });
}

// 任务申请提交
export function postSubmitApplyService(id) {
  const data = {
    'taskId': id,
  };
  return request({
    url: 'task/submitApply',
    method: 'post',
    data: data,
  });
}

// 删除任务申请
export function postDeleteApplyService(id) {
  const data = {
    'taskId': id
  };
  return request({
    url: 'task/deleteApply',
    method: 'post',
    data: data,
  });
}
// 物理删除任务申请
export function postDeleteService(id) {
  const data = {
    'taskId': id
  };
  return request({
    url: 'task/delete',
    method: 'post',
    data: data,
  });
}
// 删除任务申请
export function postResumeApplyService(id) {
  const data = {
    'taskId': id
  };
  return request({
    url: 'task/resumeApply',
    method: 'post',
    data: data,
  });
}
// 任务申请操作记录
export function getOperateLogService(
  taskId, pageNumber, pageSize, sort, order
) {
  const data = {
    'taskId': taskId,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  };
  return request({
    url: 'task/operateLog',
    method: 'get',
    data: data,
  });
}
// 任务申请审核列表（委托型）
export function getApplyAuditListService(
  taskNo, partNumber, batchNumber, sampleStatusPhase,
  projectNo, partName, partGraphNumber, materialNo,heatingNumber,
  pageNumber, pageSize, sort, order
) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'batchNumber': batchNumber,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'heatingNumber': heatingNumber,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order,
  };
  return request({
    url: 'task/applyAuditList',
    method: 'get',
    data: data,
  });
}
// 任务申请审核（委托型）
export function postApplyAuditService(
  id, result, reason
) {
  const data = {
    'taskId': id,
    'result': result,
    'reason': reason
  };
  return request({
    url: 'task/applyAudit',
    method: 'post',
    data: data,
  });
}
// 任务分配列表
export function getTobeAssignedProcessListService(
  taskNo, partNumBer, batchNumber, sampleStatusPhase,
  projectNo, partName, partGraphNumber, materialNo,heatingNumber,
  pageNumber, pageSize, sort, order) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumBer,
    'batchNumber': batchNumber,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'heatingNumber': heatingNumber,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order,
  };
  return request({
    url: 'task/tobeAssignedProcessList',
    method: 'get',
    data: data,
  });
}

// 用户管理
export function getUserList(data) {
  return request({
    url: 'user/getByCondition',
    method: 'get',
    data: data,
  });
}

// 多用户查询
export function getByInUsername(data) {
  return request({
    url: 'user/getByInUsername',
    method: 'get',
    data: data,
  });
}

// 角色管理
export function getRoleAllList(data) {
  return request({
    url: '/role/getAllList',
    method: 'get',
    data: data,
  });
}

// 组织机构
export function getOrgAllList(data) {
  return request({
    url: '/org/getAllList',
    method: 'get',
    data: data,
  });
}

// 用户新增
export function userAdd(data) {
  return request({
    url: '/user/admin/add',
    method: 'post',
    data: data,
  });
}

// 用户编辑
export function userEdit(data) {
  return request({
    url: '/user/admin/edit',
    method: 'post',
    data: data,
  });
}

// 用户启用
export function userEnable(id) {
  return request({
    url: '/user/admin/enable/' + id,
    method: 'post'
  });
}

// 用户禁用
export function userDisable(id) {
  return request({
    url: '/user/admin/disable/' + id,
    method: 'post'
  });
}

// 用户批量删除
export function userDeleteAll(data) {
  return request({
    url: '/user/delByIds',
    method: 'post',
    data: data
  });
}

// 角色集合
export function getRoleList(data) {
  return request({
    url: '/role/getAllByPage',
    method: 'get',
    data: data,
  });
}

// 权限集合
export function getPermList() {
  return request({
    url: '/permission/getAllList',
    method: 'get'
  });
}

// 角色新增
export function roleAdd(data) {
  return request({
    url: '/role/save',
    method: 'post',
    data: data,
  });
}

// 角色编辑
export function roleEdit(data) {
  return request({
    url: '/role/edit',
    method: 'post',
    data: data,
  });
}

// 角色批量删除
export function roleDeleteAll(data) {
  return request({
    url: '/role/delAllByIds',
    method: 'post',
    data: data,
  });
}

// 角色默认
export function roleSetDefault(data) {
  return request({
    url: '/role/setDefault',
    method: 'post',
    data: data,
  });
}

// 角色权限编辑
export function roleEditRolePerm(id, data) {
  return request({
    url: '/role/editRolePerm/' + id,
    method: 'post',
    data: data
  });
}

// 菜单集合
export function getMenuList(data) {
  return request({
    url: '/permission/getAllList',
    method: 'get',
    data: data,
  });
}

// 菜单编辑
export function menuEdit(data) {
  return request({
    url: '/permission/edit',
    method: 'post',
    data: data,
  });
}

// 菜单新增
export function menuAdd(data) {
  return request({
    url: '/permission/add',
    method: 'post',
    data: data,
  });
}

// 菜单批量删除
export function menuDeleteAll(data) {
  return request({
    url: '/permission/delByIds',
    method: 'post',
    data: data,
  });
}

// 日志集合
export function getLogList(data) {
  return request({
    url: '/log/getAllByPage',
    method: 'get',
    data: data,
  });
}

// 日志集合
export function getLogSearch(data) {
  return request({
    url: '/log/search',
    method: 'get',
    data: data,
  });
}

// 日志删除
export function logDeleteAll(data) {
  return request({
    url: '/log/delByIds',
    method: 'delete',
    data: data,
  });
}

// 任务领取
export function postTakeTaskService(taskId) {
  const data = {
    'taskId': taskId
  };
  return request({
    url: 'task/takeTask',
    method: 'post',
    data: data,
  });
}
// 任务分配
export function postTaskAssignService(
  taskId, uid
) {
  const data = {
    'taskId': taskId,
    'uid': uid
  };
  return request({
    url: 'task/taskAssign',
    method: 'post',
    data: data,
  });
}
// 样品接收列表
export function getTaskSampleListService(
  form) {
  const data = form;
  // {
  //   'taskNo': taskNo,
  //   'partNumber': partNumBer,
  //   'batchNumber': batchNumber,
  //   'sampleStatusPhase': sampleStatusPhase,
  //   'projectNo': projectNo,
  //   'partName': partName,
  //   'partGraphNumber': partGraphNumber,
  //   'materialNo': materialNo,
  //   'pageNumber': pageNumber,
  //   'pageSize': pageSize,
  //   'sort': sort,
  //   'order': order,
  // };
  return request({
    url: 'task/taskSampleList',
    method: 'get',
    data: data,
  });
}

// 样品接收
// 待报告列表
export function getReportListService(
  data
) {

  return request({
    url: 'task/reportList',
    method: 'get',
    data: data,
  });
}
export function getAllReportListService(
  form
) {

  return request({
    url: 'task/allReportList',
    method: 'get',
    data: form,
  });
}
export function qrcodedelList(
  form
) {

  return request({
    url: 'task/qrcodedelList',
    method: 'get',
    data: form,
  });
}
export function getDrawListService(
  taskNo, partNumber, batchNumber, sampleStatusPhase,
  projectNo, partName, partGraphNumber, materialNo,
  pageNumber, pageSize, sort, order
) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'batchNumber': batchNumber,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  };
  return request({
    url: 'task/drawList',
    method: 'get',
    data: data,
  });
}

export function postDeleteAttach(attachId){
  return request({
    url: 'task/deleteAttach',
    method: 'post',
    data: {attachId},
  });
}

// 保存报告
export function postSaveReportService(
  task
) {

  const data = {
    ...task
  };

  // if(data.taskTarget){
  //   data.taskTarget=data.taskTarget.join(',');
  // }

  return request({
    url: 'task/saveReport',
    method: 'post',
    data: data,
  });
}
export function postTempSaveReportService(
  task
) {

  const data = {
    ...task
  };

  // if(data.taskTarget){
  //   data.taskTarget=data.taskTarget.join(',');
  // }

  return request({
    url: 'task/tempSaveReport',
    method: 'post',
    data: data,
  });
}
// 报告附件上传
export function postUploadAttachService(taskId) {
  const data = {
    'taskId': taskId
  };
  return request({
    url: 'task/uploadAttach',
    method: 'post',
    data: data,
  });
}

// 领取样品
export function postTakeSampleService(taskId) {
  const data = {
    'taskId': taskId
  };
  return request({
    url: 'task/takeSample',
    method: 'post',
    data: data,
  });
}
export function postBatchTakeSampleService(data) {

  return request({
    url: 'task/takeSample',
    method: 'post',
    data: data,
  });
}
// 报告附件删除
export function postAttatchDeleteService(attachId) {
  const data = {
    'attachId': attachId
  };
  return request({
    url: 'task/attatchDelete',
    method: 'post',
    data: data,
  });
}
// 报告审核列表
export function getReportAuditListService(
  taskNo, partNumber, batchNumber,partName, sampleStatusPhase,
  projectNo,  partGraphNumber, materialNo,
  pageNumber, pageSize, sort, order
) {

  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'batchNumber': batchNumber,
    'partName': partName,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order,
  };
  return request({
    url: 'task/reportAuditList',
    method: 'get',
    data: data,
  });
}
// 报告审核
export function postReportAuditService(
  taskId, pass, reason
) {
  const data = {
    'taskId': taskId,
    'result': pass,
    'reason': reason
  };
  return request({
    url: 'task/reportAudit',
    method: 'post',
    data: data,
  });
}
// 报告查看
export function getViewReportService(
  username, mobile, empNo, pageNumber, pageSize, sort, order
) {
  const data = {
    'username': username,
    'mobile': mobile,
    'empNo': empNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  };
  return request({
    url: 'task/viewReport',
    method: 'get',
    data: data,
  });
}
// 报告附件下载
export function getDownloadAttachService(attachId) {
  const data = {
    'attachId': attachId
  };
  return request({
    url: 'task/downloadAttach',
    method: 'get',
    data: data,
  });
}
// 报告二次审核列表
export function getReportSecondAuditListService(
  taskNo, partNumber, batchNumber, sampleStatusPhase,
  projectNo, partName, partGraphNumber, materialNo,
  pageNumber, pageSize, sort, order
) {

  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'batchNumber': batchNumber,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order,
  };
  return request({
    url: 'task/reportSecondAuditList',
    method: 'get',
    data: data,
  });
}
// 报告二次审核
export function postReportSecondAuditService(
  taskId, pass, isPush,reason
) {
  const data = {
    'taskId': taskId,
    'result': pass,
    'isPush': isPush,
    'reason': reason
  };
  return request({
    url: 'task/reportSecondAudit',
    method: 'post',
    data: data,
  });
}

// 修改密码
export function modifyPass(data) {
  return request({
    url: 'user/modifyPass',
    method: 'post',
    data: data,
  });
}

// 报告撤回
export function postDrawReportService(taskId) {
  const data = {
    'taskId': taskId,
  };
  return request({
    url: 'task/drawReport',
    method: 'post',
    data: data,
  });
}
// 完成报告列表
export function postFinishedListService(
  taskNo, partNumber, batchNumber, sampleStatusPhase,
  projectNo, partName, partGraphNumber, materialNo,
  pageNumber, pageSize, sort, order
) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'batchNumber': batchNumber,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order,
  };
  return request({
    url: 'task/finishedList',
    method: 'post',
    data: data,
  });
}
// 任务管理-任务列表
export function getTaskManageListService(
  form) {

  return request({
    url: 'task/taskManageList',
    method: 'get',
    data: form,
  });
}

// 任务管理-任务显示/隐藏
export function postShowProcessService(
  username, mobile, empNo, pageNumber, pageSize,
  sort, order
) {
  const data = {
    'username': username,
    'mobile': mobile,
    'empNo': empNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  };
  return request({
    url: 'task/showProcess',
    method: 'post',
    data: data,
  });
}


// 获取零件信息
export function getPartList(data) {
  return request({
    url: 'part/partList',
    method: 'get',
    data: data,
  });
}
// 零件明细
export function getPartInfo(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'part/partInfo/' + id,
    method: 'get',
    data: data,
  });
}
// 零件保存
export function postSavePart(data) {
  return request({
    url: 'part/savePart',
    method: 'post',
    data: data,
  });
}

// 批量删除PartField
export function partFieldDelete(data) {
  return request({
    url: 'partField/deletePartField/delByIds',
    method: 'post',
    data: data,
  });
}

export function checkRole(role){
  let roleNameStr=localStorage.getItem('__USER_ROLE');
  if(roleNameStr&&roleNameStr!=''){
    let roles=roleNameStr.split(',');
    for(let i=0;i<roles.length;i++){
      if(role==roles[i]){
        return true;
      }
    }
  }
  return false;
}

// 获取用户信息
export function getUserInfo() {
  return request({
    url: 'user/info',
    method: 'get'
  });
}
// 获取用户信息
export function getNextTaskNo() {
  return request({
    url: 'task/nextTaskNo',
    method: 'get'
  });
}

export function getFiledListByPartId(id) {
  return request({
    url: 'partField/getFieldByPartNumber',
    data: {
      partId: id
    },
    method: 'get'
  });
}

// 检测项目列表
export function getTestFieldList(data) {
  return request({
    url: 'testField/testFieldList',
    method: 'get',
    data: data
  });
}
export function getPartFieldList(data) {
  return request({
    url: 'partField/partFieldList',
    method: 'get',
    data: data
  });
}


// 检测项目保存
export function postSaveTestField(data) {
  return request({
    url: 'testField/saveTestField',
    method: 'post',
    data: data
  });
}
// 检测项目信息
export function getTestFieldInfo(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'testField/testFieldInfo/' + id,
    method: 'get',
    data: data
  });
}

// 检测项目批量删除
export function testFieldAllDelete(data) {
  return request({
    url: 'testField/deleteTestField/delByIds',
    method: 'post',
    data: data
  });
}

// 检测项目删除
export function testFieldDelete(id) {
  return request({
    url: 'testField/deleteTestField/' + id,
    method: 'delete',
  });
}

// 检测位置
export function getPositionList() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: dictTestPosition
    }
  });
}
export function getSampleStatusPhase() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: 'SAMPLE_STATUS_PHASE'
    }
  });
}
export function getSampleStatusDrop() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: 'SAMPLE_STATUS'
    }
  });
}
// 检测位置
export function getStandardCondition() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: standardOperator
    }
  });
}
// 检测项目列表去重
export function getFindByFieldName() {
  return request({
    // url: 'partField/findByFieldName',
        url: 'dict/dictList',

    method: 'get'
   });
}
//检测类型
export function getTypeList() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: dictTestType
    }
  });
}
//检测类型
export function getFieldStandardList(param) {
  return request({
    url: 'fieldStandard/allStandardList',
    method: 'get',
    data: param
  });
}

//检测类型
export function getPartTypeList() {
  return request({
    url: 'partType/allTypeList',
    method: 'get',
    data: {}
  });
}

//材料号
export function getMaterialNo() {
  return request({
    url: 'part/getPartByDistinctMaterialNo',
    method: 'get',
    data: {}
  });
}

export function getDetectionStandardFrom() {
  return request({
    url: 'dict/dictList',
    method: 'get',
    data: {
      parentCode: 'DETECTION_STANDARD_FROM'
    }
  });
}



// 设备信息列表
export function getDviceList(data) {
  return request({
    url: 'device/deviceList',
    method: 'get',
    data: data
  });
}
export function getUsableDeviceList(data) {
  return request({
    url: 'device/usableDeviceList',
    method: 'get',
    data: data
  });
}
// 设备保存
export function postSaveDevice(data) {
  return request({
    url: 'device/saveDevice',
    method: 'post',
    data: data
  });
}
// 设备保存
export function getDeviceInfo(id) {
  const data = {};
  return request({
    url: 'device/deviceInfo/' + id,
    method: 'get',
    data: data
  });
}

// 设备批量删除
export function deviceAllDelete(data) {
  return request({
    url: 'device/deleteDevice/delByIds',
    method: 'post',
    data: data
  });
}

export function deleteDevice(id) {
  return request({
    url: 'device/deleteDevice/' + id,
    method: 'delete'
  });
}

// 电子签名列表
export function getElecSignaturelList(data) {
  return request({
    url: 'elecSignature/elecSignaturelList',
    method: 'get',
    data: data
  });
}
// 电子签名保存
export function saveElecSignature(data) {
  return request({
    url: 'elecSignature/saveElecSignature',
    method: 'post',
    data: data
  });
}
// 电子签名详细
export function elecSignatureInfo(id) {
  const data = {};
  return request({
    url: 'elecSignature/elecSignatureInfo/' + id,
    method: 'get',
    data: data
  });
}

// 电子签名删除
export function deleteElecSignature(id) {
  return request({
    url: 'elecSignature/deleteElecSignature/' + id,
    method: 'delete'
  });
}

// 电子印章列表
export function getElecSealList(data) {
  return request({
    url: 'elecSeal/elecSealList',
    method: 'get',
    data: data
  });
}
// 电子印章保存
export function saveElecSeal(data) {
  return request({
    url: 'elecSeal/saveElecSeal',
    method: 'post',
    data: data
  });
}
// 电子印章详细
export function elecSealInfo(id) {
  const data = {};
  return request({
    url: 'elecSeal/elecSealInfo/' + id,
    method: 'get',
    data: data
  });
}

// 电子印章删除
export function deleteElecSeal(id) {
  return request({
    url: 'elecSeal/deleteElecSeal/' + id,
    method: 'delete'
  });
}

// 电子公章批量删除
export function electronicSealAllDelete(data) {
  return request({
    url: 'elecSeal/deleteElecSeal/delByIds',
    method: 'post',
    data: data
  });
}

// 理化检测项目统计
export function getProjectStatistics(data) {
  return request({
    url: 'report/findByPartNum',
    method: 'get',
    data: data
  });
}

// 人员系数统计
export function gePersonnelCoefficientStatistics(data) {
  return request({
    url: 'report/findByStaffModulus',
    method: 'get',
    data: data
  });
}

// 人员系数统计详情
export function gePersonnelCoefficientStatisticsInfor(data) {
  return request({
    url: 'report/findByStaffModulusInfor',
    method: 'get',
    data: data
  });
}

// 人员任务完成及时率
export function getPersonCompletionRate(data) {
  return request({
    url: 'report/findByCompletionRate',
    method: 'get',
    data: data
  });
}

// 人员任务完成及时率详情
export function getPersonCompletionRateInfor(data) {
  return request({
    url: 'report/findByCompletionRateInfor',
    method: 'get',
    data: data
  });
}

// 合格率
export function getPercentOfPass(data) {
  return request({
    url: 'report/findByQualifiedRate',
    method: 'get',
    data: data
  });
}

// 设备使用率
export function getEquipmentUtilization(data) {
  return request({
    url: 'report/findByDevice',
    method: 'get',
    data: data
  });
}


export function getDeviceOccupyDetail(data) {
  debugger;
  return request({
    url: 'report/findDeviceDetailData',
    method: 'get',
    data: data
  });
}

// 原材料炉号生产零件信息表
export function getMaterialFurnance(data) {
  return request({
    url: 'report/findByMaterialFurnance',
    method: 'get',
    data: data
  });
}

// 零件检测数据汇总表
export function getPartNumTotal(data) {
  return request({
    url: 'report/findByPartNumTotal',
    method: 'get',
    data: data
  });
}

// 任务目的信息
export function getTaskObjListService(taskObjName, roldName) {
  const data = {
    'taskObjName': taskObjName,
    'roldName': roldName
  };
  return request({
    url: 'taskObj/taskObjList',
    method: 'get',
    data: data,
  });
}

// 用户列表
export function getByCondition(data) {
  return request({
    url: 'user/getByCondition',
    method: 'get',
    data: data
  });
}

// 获取角色列表
export function getAllRoleList() {
  return request({
    url: 'role/getAllList',
    method: 'get'
  });
}


// 计划完成时间设置列表
export function getPlanTimeSettingList(data) {
  return request({
    url: 'planTimeSetting/planTimeSettingList',
    method: 'get',
    data: data
  });
}
// 计划完成时间设置详细
export function getPlanTimeSetting(id) {
  return request({
    url: 'planTimeSetting/planTimeSetting/' + id,
    method: 'get'
  });
}
// 计划完成时间设置保存
export function savePlanTimeSetting(data) {
  return request({
    url: 'planTimeSetting/savePlanTimeSetting',
    method: 'post',
    data: data
  });
}

// 计划完成时间设置删除
export function deletePlanTimeSetting(id) {
  return request({
    url: 'planTimeSetting/deletePlanTimeSetting/' + id,
    method: 'delete'
  });
}


// 检测项目占用时间设置列表
export function getFieldOccupyTimeSettingList(data) {
  return request({
    url: 'fieldOccupyTimeSetting/fieldOccupyTimeSettingList',
    method: 'get',
    data: data
  });
}
// 检测项目占用时间设置详细
export function getFieldOccupyTimeSetting(id) {
  return request({
    url: 'fieldOccupyTimeSetting/fieldOccupyTimeSettingInfo/' + id,
    method: 'get'
  });
}
// 检测项目占用时间设置保存
export function saveFieldOccupyTimeSetting(data) {
  return request({
    url: 'fieldOccupyTimeSetting/saveFieldOccupyTimeSetting',
    method: 'post',
    data: data
  });
}

// 检测项目占用时间设置删除
export function deleteFieldOccupyTimeSetting(id) {
  return request({
    url: 'fieldOccupyTimeSetting/deleteFieldOccupyTimeSetting/' + id,
    method: 'delete'
  });
}

// 样品状态阶段列表
export function getSampleStatusStageList() {
  return request({
    url: 'dict/sampleStatusStageList',
    method: 'get'
  });
}
// 样品状态阶段信息
export function getSampleStatusStage(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/sampleStatusStage',
    method: 'get',
    data: data
  });
}
// 样品状态阶段保存
export function getSaveSampleStatusStage(data) {
  return request({
    url: 'dict/saveSampleStatusStage',
    method: 'post',
    data: data
  });
}
// 样品状态阶段删除
export function postDeleteSampleStatusStage(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/deleteSampleStatusStage',
    method: 'post',
    data: data
  });
}

// SAP零件号设置列表
export function getSapPartNumSettingList() {
  return request({
    url: 'dict/sapPartNumSettingList',
    method: 'get'
  });
}
// SAP零件号设置信息
export function getSapPartNumSetting(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/sapPartNumSetting',
    method: 'get',
    data: data
  });
}
// SAP零件号设置保存
export function postSaveSapPartNumSetting(data) {
  return request({
    url: 'dict/saveSapPartNumSetting',
    method: 'post',
    data: data
  });
}
// SAP零件号设置删除
export function postDeleteSapPartNumSetting(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/deleteSapPartNumSetting',
    method: 'post',
    data: data
  });
}

// 任务目的信息列表
export function getTaskObjList(data) {
  return request({
    url: 'taskObj/taskObjList',
    method: 'get',
    data: data
  });
}
// 任务目的信息
export function getTaskObj(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'taskObj/getTaskObj',
    method: 'get',
    data: data
  });
}
// 任务目的保存
export function saveTaskObj(data) {
  return request({
    url: 'taskObj/saveTaskObj',
    method: 'post',
    data: data
  });
}
// 任务目的删除
export function deleteTaskObj(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'taskObj/deleteTaskObj',
    method: 'post',
    data: data
  });
}

// 检测位置信息维护列表
export function getTestPartList() {
  return request({
    url: 'dict/testPartList',
    method: 'get'
  });
}
// 检测位置信息维护信息
export function getTestPart(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/testPart',
    method: 'get',
    data: data
  });
}
// 检测位置信息维护保存
export function postSaveTestPart(data) {
  return request({
    url: 'dict/saveTestPart',
    method: 'post',
    data: data
  });
}
// 检测位置信息维护删除
export function postDeleteTestPart(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/deleteTestPart',
    method: 'post',
    data: data
  });
}

// 样品状态列表
export function getSampleStatusList() {
  return request({
    url: 'dict/sampleStatusList',
    method: 'get'
  });
}
// 样品状态信息
export function getSampleStatus(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/sampleStatus',
    method: 'get',
    data: data
  });
}
// 样品状态保存
export function postSaveSampleStatus(data) {
  return request({
    url: 'dict/saveSampleStatus',
    method: 'post',
    data: data
  });
}
// 样品状态删除
export function postDeleteSampleStatus(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/deleteSampleStatus',
    method: 'post',
    data: data
  });
}



// 设备类型列表
export function getDeviceTypeList(data) {
  return request({
    url: 'dict/deviceTypeList',
    method: 'get',
    data: data
  });
}
// 设备类型信息
export function getDeviceType(data) {
  return request({
    url: 'dict/getDeviceType',
    method: 'get',
    data: data
  });
}
// 设备类型保存
export function saveDeviceType(data) {
  return request({
    url: 'dict/saveDeviceType',
    method: 'post',
    data: data
  });
}
// 设备类型删除
export function deleteDeviceType(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'dict/deleteDeviceType',
    method: 'post',
    data: data
  });
}
// 零件删除
export function deletePart(part) {
  const data = part
  return request({
    url: 'part/partDelete',
    method: 'post',
    data: data
  });
}

// 零件批量删除
export function partAllDelete(data) {
  return request({
    url: 'part/deletePart/delByIds',
    method: 'post',
    data: data
  });
}

// 提醒时间列表
export function noticeSettingList() {
  return request({
    url: 'noticeSetting/noticeSettingList',
    method: 'get',
  });
}
// 提醒时间信息
export function noticeSetting(data) {
  return request({
    url: 'noticeSetting/noticeSetting',
    method: 'get',
    data: data
  });
}
// 提醒时间保存
export function saveNoticeSetting(data) {
  return request({
    url: 'noticeSetting/saveNoticeSetting',
    method: 'post',
    data: data
  });
}
// 提醒时间删除
export function deleteNoticeSetting(id) {
  const data = {
    'id': id
  }
  return request({
    url: 'noticeSetting/deleteNoticeSetting',
    method: 'post',
    data: data
  });
}

// 部门列表
export function getDepartmentList(data) {
  return request({
    url: 'org/orgList',
    method: 'get',
    data: data
  });
}
// 部门详细
export function getDepartment(id) {
  return request({
    url: 'org/orgInfo/' + id,
    method: 'get'
  });
}
// 部门保存
export function saveDepartment(data) {
  return request({
    url: 'org/saveOrg',
    method: 'post',
    data: data
  });
}

// 部门删除
export function deleteDepartment(id) {
  return request({
    url: 'org/deleteOrg/' + id,
    method: 'delete'
  });
}

// 待办事项
export function getMyTodo(taskNo, taskStatus, applyStart, applyEnd, pageNumber, pageSize, sort, order) {
  const data = {
    'taskNo': taskNo,
    'taskStatus': taskStatus,
    'applyStart': applyStart,
    'applyEnd': applyEnd,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  }
  return request({
    url: 'task/myTodo',
    method: 'get',
    data: data
  });
}
// 提醒中心
export function getMyNotice(data) {
   return request({
    url: 'notice/myNotice',
    method: 'get',
    data: data
  });
}
// 我提交的申请
export function getMyApply(taskNo, partNumber, heatingNumber, applyStart, applyEnd, partName, partGraphNumber, taskStatus, pageNumber, pageSize, sort, order) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'heatingNumber': heatingNumber,
    'applyStart': applyStart,
    'applyEnd': applyEnd,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'taskStatus': taskStatus,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  }
  return request({
    url: 'task/myApply',
    method: 'get',
    data: data
  });
}
// 被退回的申请
export function getRejectApply(taskNo, partNumber, heatingNumber, applyStart, applyEnd, partName, partGraphNumber, tastStatus, pageNumber, pageSize, sort, order) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'heatingNumber': heatingNumber,
    'applyStart': applyStart,
    'applyEnd': applyEnd,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'tastStatus': tastStatus,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  }
  return request({
    url: 'task/rejectApply',
    method: 'get',
    data: data
  });
}
//已完成的申请
export function getCompleteApply(taskNo, partNumber, heatingNumber, applyStart, applyEnd, partName, partGraphNumber, tastStatus, pageNumber, pageSize, sort, order) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'heatingNumber': heatingNumber,
    'applyStart': applyStart,
    'applyEnd': applyEnd,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'tastStatus': tastStatus,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  }
  return request({
    url: 'task/completeApply',
    method: 'get',
    data: data
  });
}
// 我参与的工作流
export function getMyProcess(taskNo, partNumber, batchNumber, sampleStatusPhase, projectNo, partName, partGraphNumber, materialNo, pageNumber, pageSize, sort, order) {
  const data = {
    'taskNo': taskNo,
    'partNumber': partNumber,
    'batchNumber': batchNumber,
    'sampleStatusPhase': sampleStatusPhase,
    'projectNo': projectNo,
    'partName': partName,
    'partGraphNumber': partGraphNumber,
    'materialNo': materialNo,
    'pageNumber': pageNumber,
    'pageSize': pageSize,
    'sort': sort,
    'order': order
  }
  return request({
    url: 'task/myProcess',
    method: 'get',
    data: data
  });




}
